package ua.epam.java_bravo.data.dao;

import ua.epam.java_bravo.data.dto.HsAddress;
import ua.epam.java_bravo.data.dto.pk.HsAddressPk;
import ua.epam.java_bravo.data.exception.HsAddressDaoException;

public interface HsAddressDao {
    /**
     * Inserts a new row in the HS_Address table.
     */
    public ua.epam.java_bravo.data.dto.pk.HsAddressPk insert(HsAddress dto) throws HsAddressDaoException;

    /**
     * Updates a single row in the HS_Address table.
     */
    public void update(HsAddressPk pk, HsAddress dto) throws HsAddressDaoException;

    /**
     * Deletes a single row in the HS_Address table.
     */
    public void delete(HsAddressPk pk) throws HsAddressDaoException;

    /**
     * Deletes ALL entries in the HS_Address table
     */
    public void deleteAllRecords() throws HsAddressDaoException;

    /**
     * Returns the rows from the HS_Address table that matches the specified primary-key value.
     */
    public HsAddress findByPrimaryKey(HsAddressPk pk) throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the criteria 'address_id = :addressId'.
     */
    public HsAddress findByPrimaryKey(int addressId) throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the criteria ''.
     */
    public HsAddress[] findAll() throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the criteria 'address_id = :addressId'.
     */
    public HsAddress[] findWhereAddressIdEquals(int addressId) throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the criteria 'street = :street'.
     */
    public HsAddress[] findWhereStreetEquals(String street) throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the criteria 'house = :house'.
     */
    public HsAddress[] findWhereHouseEquals(int house) throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the criteria 'flat = :flat'.
     */
    public HsAddress[] findWhereFlatEquals(int flat) throws HsAddressDaoException;

    /**
     * Sets the value of maxRows
     */
    public void setMaxRows(int maxRows);

    /**
     * Gets the value of maxRows
     */
    public int getMaxRows();

    /**
     * Returns all rows from the HS_Address table that match the specified arbitrary SQL statement
     */
    public HsAddress[] findByDynamicSelect(String sql, Object[] sqlParams) throws HsAddressDaoException;

    /**
     * Returns all rows from the HS_Address table that match the specified arbitrary SQL statement
     */
    public HsAddress[] findByDynamicWhere(String sql, Object[] sqlParams) throws HsAddressDaoException;

}
